package ign;

import ign.agents.Generator;
import ign.agents.IHM;
import jade.core.Profile;
import jade.core.ProfileImpl;
import jade.core.Runtime;
import jade.wrapper.AgentContainer;
import jade.wrapper.AgentController;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 * Classe qui lance Jade et les agents minimaux : l'ihm et le générateur.
 * @author Simon Bourigaut & Ghislain Di Paolo
 */
public class Main {
	
	public static void main(String[] args) {	
		
		Runtime rt = Runtime.instance();
		rt.setCloseVM(true);
		
		Profile pMain = new ProfileImpl("localhost", 25667, null);
		AgentContainer mc = rt.createMainContainer(pMain);
		
		/* Lancement des agents */
		try {
			AgentController ihm = mc.createNewAgent("ihm", IHM.class.getName(), new Object[0]);
			AgentController generator = mc.createNewAgent("generator", Generator.class.getName(), new Object[0]);
			ihm.start();
			generator.start();
		} catch (Exception e) {
			Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, e);
		}
	}

}
